# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Firmicus <francois.archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

_name=urw-base35-fonts
pkgname=gsfonts
pkgver=20200910
pkgrel=2
pkgdesc="(URW)++ base 35 font set"
url="https://github.com/ArtifexSoftware/urw-base35-fonts"
arch=('any')
license=('AGPL3')
source=("${_name}-${pkgver}.tar.gz::https://github.com/ArtifexSoftware/${_name}/archive/refs/tags/${pkgver}.tar.gz")
sha512sums=('71fb27baadf5abc4ff624cdede02038681acd5fffdc728a5b2e7808713b80cb2f2174f90a1862e69d390c4434c49d5167ab095100032fa3ba80b586eb8ae51d1')
b2sums=('77305946e6ab6e576cca7b62da731709bf4acaeb7181f89aef032f922acfaad59735a651d73ff8793c2cf32a23f45efaf5322568892023d4eae9b2278f681890')

package() {
  local _config _config_path
  cd "${_name}-${pkgver}"

  install -vDm 644 fonts/*.otf -t "${pkgdir}/usr/share/fonts/${pkgname}"
  install -vDm 644 appstream/*.xml -t "${pkgdir}/usr/share/metainfo"

  install -vdm 755 "${pkgdir}/usr/share/fontconfig/conf.default/"
  for _config in fontconfig/*.conf; do
    _config_path="${pkgdir}/usr/share/fontconfig/conf.avail/69-${_config##*/}"
    install -vDm 644 "${_config}" "${_config_path}"
    ln -srt "${pkgdir}/usr/share/fontconfig/conf.default/" "${_config_path}"
  done
}
